
function hidehud(name)
	for k, v in pairs{"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"} do
		if name == v then return false end
	end
end

local function drawHealth()
	local Health = math.Clamp(LocalPlayer():Health(), 0, 100)
	local PropCount = math.Clamp(LocalPlayer():GetCount("props"), 0, tonumber(GetConVarString("sbox_maxprops")))
	local MoveH = (LocalPlayer():Health() * 3) -1
	
	if PropCount > 0 then
	MoveP = ((PropCount/tonumber(GetConVarString("sbox_maxprops"))) * 299)
	else 
		MoveP = 0
	end
	
	draw.RoundedBox( 0, 50, (ScrH() - 120), 305, 30, Color( 0, 0, 0, 180 ) )
	draw.RoundedBox( 0, 50, (ScrH() - 90), 305, 60, Color( 0, 0, 0, 150 ) )
	if (Health > 0) then
		draw.RoundedBox( 2, 52, (ScrH() - 118), MoveH+1, 26, Color( (Health * -2) + 200, (Health * 2), 0, 180 ) )
	end
	if (PropCount > 0) then
		draw.RoundedBox( 2, 52, (ScrH() - 90), MoveP+1, 15, Color( ((PropCount/tonumber(GetConVarString("sbox_maxprops"))) * 255), (((PropCount/tonumber(GetConVarString("sbox_maxprops")))+255) * -255), 0, 180 ) )
	end

	draw.DrawText( tostring(Health).." Health", "ScoreboardText", 170, (ScrH() - 116), Color( 255, 255, 255, 255 ), 0 )
	draw.DrawText( "Props: " .. tostring(LocalPlayer():GetCount("props")).."/".. tonumber(GetConVarString("sbox_maxprops")), "ScoreboardText", 200, (ScrH() - 92), Color( 255, 255, 255, 255 ), 1 )
	draw.DrawText( "Rank: " .. tostring(team.GetName(LocalPlayer():Team())), "ScoreboardText", 55, (ScrH() - 70), Color( 200, 200, 200, 255 ), 0 )
	draw.DrawText( "Ping: " .. tostring(LocalPlayer():Ping()), "ScoreboardText", 55, (ScrH() - 50), Color( 200, 200, 200, 255 ), 0 )
	draw.RoundedBox( 0, (ScrW()-355), (ScrH() - 120), 305, 30, Color( 0, 0, 0, 180 ) )
	
if LocalPlayer():GetEyeTraceNoCursor().Entity:IsValid() then
if LocalPlayer():GetEyeTraceNoCursor().Entity:GetClass() == "player" || LocalPlayer():GetEyeTraceNoCursor().Entity:GetClass() == "npc_*" then
	local Health = math.Clamp(LocalPlayer():GetEyeTraceNoCursor().Entity:Health(), 0, 100)
	local PropCount = math.Clamp(LocalPlayer():GetEyeTraceNoCursor().Entity:GetCount("props"), 0, tonumber(GetConVarString("sbox_maxprops")))
	local MoveH = (LocalPlayer():GetEyeTraceNoCursor().Entity:Health() * 3) -1
	
	if PropCount > 0 then
	MoveP = ((PropCount/tonumber(GetConVarString("sbox_maxprops"))) * 299)
	else 
		MoveP = 0
	end
	
	draw.RoundedBox( 0, (ScrW()-355), (ScrH() - 140), 305, 20, Color( 0, 0, 0, 150 ) )
	draw.RoundedBox( 0, (ScrW()-355), (ScrH() - 120), 305, 30, Color( 0, 0, 0, 180 ) )
	draw.RoundedBox( 0, (ScrW()-355), (ScrH() - 90), 305, 60, Color( 0, 0, 0, 150 ) )
	if (Health > 0) then
		draw.RoundedBox( 2, (ScrW()-352), (ScrH() - 118), MoveH+1, 26, Color( (Health * -2) + 200, (Health * 2), 0, 180 ) )
	end
	if (PropCount > 0) then
		draw.RoundedBox( 2, (ScrW()-352), (ScrH() - 90), MoveP+1, 15, Color( ((PropCount/tonumber(GetConVarString("sbox_maxprops"))) * 255), (((PropCount/tonumber(GetConVarString("sbox_maxprops")))+255) * -255), 0, 180 ) )
	end
	draw.DrawText( tostring(Health).." Health", "ScoreboardText", (ScrW()-230), (ScrH() - 116), Color( 255, 255, 255, 255 ), 0 )
	
	draw.DrawText( "Props: " .. tostring(LocalPlayer():GetEyeTraceNoCursor().Entity:GetCount("props")).."/".. tonumber(GetConVarString("sbox_maxprops")), "ScoreboardText", (ScrW()-200), (ScrH() - 92), Color( 200, 200, 200, 255 ), 1 )
	draw.DrawText( "Rank: " .. tostring(team.GetName(LocalPlayer():GetEyeTraceNoCursor().Entity:Team())), "ScoreboardText", (ScrW()-350), (ScrH() - 70), Color( 200, 200, 200, 255 ), 0 )
	draw.DrawText( "Ping: " .. tostring(LocalPlayer():GetEyeTraceNoCursor().Entity:Ping()), "ScoreboardText", (ScrW()-350), (ScrH() - 50), Color( 200, 200, 200, 255 ), 0 )
	draw.DrawText( tostring(LocalPlayer():GetEyeTraceNoCursor().Entity:Nick()), "ScoreboardText", (ScrW()-350), (ScrH() - 138), Color( 255, 255, 255, 255 ), 0 )
end
end
end

hook.Add("HUDPaint","DrawHealth",drawHealth)
hook.Add("HUDShouldDraw", "hidehud", hidehud)